import React,{ useState } from "react"
function TodoAdd(props){
    const [value, setValue] =useState('ADD');
    function onChangeHandle(e){
        setValue(e.target.value);
    }
    function addTodoHandle(){
        props.addTodo(value);
        setValue("");
    }
    return(
        <div>
            <input type="text" value={value} onChange={onChangeHandle}/><button onClick={addTodoHandle}>add</button>
        </div>)
}
export default TodoAdd